<template>
  <!-- 辅助检查详情 -->
  <section v-if="dataInfo">
    <h3 style="text-align:center;margin:0;">{{dataInfo.payStatusDisplay}}</h3>
    <br>
    <table style="width:100%;border:0;">
      <tr>
        <td>开单医生：{{dataInfo.doctorName}}</td>
        <td>开单时间：{{dataInfo.time}}</td>
        <td>报告时间：{{dataInfo.reportTime}}</td>
        <td>报告人：{{dataInfo.reportUserName}}</td>
      </tr>
    </table>
    <br>
    <div style="margin-bottom:15px;">检查报告：</div>
    <ul class="image-box">
      <li v-for="(item,index) in imgUrl" :key="index">
        <!-- <el-image class="report-image" fit="cover" :src="item" :preview-src-list="imgUrl"></el-image> -->
        <el-link type="primary" @click="onOpenUrl(item)">{{item}}</el-link>
      </li>
    </ul>
    <div style="margin-bottom:15px;">描述：{{dataInfo.describe}}</div>
    <div style="margin-bottom:15px;">结论：{{dataInfo.result}}</div>
  </section>
</template>
<script>
export default {
  props: ["dataItem"],
  computed: {
    imgUrl() {
      const th = this;
      let arr = [];
      if (th.dataInfo.urls) {
        arr = th.dataInfo.urls;
      }
      return arr;
    }
  },
  data() {
    return {
      dataInfo: null
    };
  },
  created() {
    const th = this;
  },
  mounted() {
    const th = this;
    th.getData();
  },
  methods: {
    onOpenUrl(url){
      window.open(this.$config.imageUrl+url);
    },
    getData() {
      const th = this;
      let j = {
        cureAssistId: th.dataItem.cureAssistInfo.id
      };
      th.$api.cureAssistdetail(j).then(res => {
        if (res.executed) {
          th.dataInfo = res.data[0];
        }
      });
    }
  }
};
</script>